package org.example;

import org.example.command.*;

import java.util.ArrayList;
import java.util.List;

public class Controller {
    List<Command> openCommandList = new ArrayList<>();
    List<Command> closeCommandList = new ArrayList<>();

    public void setCommand(Command openCommand, Command closeCommand){
        openCommandList.add(openCommand);
        closeCommandList.add(closeCommand);
    }

    public Controller(){
        setCommand(new OpenCommand1(), new CloseCommand1());
        setCommand(new OpenCommand2(), new CloseCommand2());
        setCommand(new OpenCommand3(), new CloseCommand3());
    }

    public void open1(){
        openCommandList.get(0).execute();
    }
    public void close1(){
        closeCommandList.get(0).execute();
    }

    public void open2(){
        openCommandList.get(1).execute();
    }
    public void close2(){
        closeCommandList.get(1).execute();
    }

}
